1. Field of the Invention
The present invention relates to an imaging device with an autofocus function and an imaging method, in particular, to an imaging device which can accurately perform autofocus operation to a subject as a night scene in which point sources are a dominant subject.
2. Description of the Related Art
An imaging device as a digital camera having an autofocus (AF) unit is known. Such an AF unit generates image data from the image signals of a subject obtained via an image sensor, generates data to automatically decide an in-focus position according to the image data, and moves an imaging lens to the in-focus position.
There are several types of AF operation of the AF unit. The AF unit incorporated in a general imaging device uses a hill climb AF system (for example, disclosed in Japanese Patent Application Publication No. S39-5265). The hill climb AF system is to calculate an integral value of a difference in brightness of neighboring pixels from an image signal output from an image sensor and determine an in-focus position using the integral value. This integral value is referred to as AF evaluation value.
When an imaging lens is in a position to capture a subject in focus, the outline of a subject image on the light-receiving surface of the image sensor is sharp so that a difference in brightness between the neighboring pixels of image signals of the subject image is large. Larger AF evaluation values are obtained in the in-focus state. Meanwhile, the outline of a subject not in focus is blurred so that a difference in brightness between the neighboring pixels is small and so is the AF evaluation value.
The hill climb AF system is to detect a peak of the AF evaluation value on the basis of the above principle to automatically focus a subject. The hill climb type AF unit obtains an image signal at certain timing or interval while moving the imaging lens, calculates the AF evaluation value, and identifies a lens position where the AF evaluation value is maximal or at peak. A subject can be automatically focused by moving the imaging lens to the lens position having the maximal AF evaluation value.
The hill climb AF system moves the imaging lens all over a moving range once and finds a lens position with the maximal AF evaluation value in the range, and moves the lens to the lens position.
Specifically, the lens start position in AF operation is set to the center of the moving range. First, the imaging lens is moved to the center of the moving range. Then, the lens is moved in a certain direction, for example, to the closest in-focus position, and then reversely moved to the infinite in-focus position. The AF evaluation value is calculated at certain timing in this moving range to identify the lens position with the maximal AF evaluation value.
Recent image sensors improved resolution and some of them have several hundred mega pixels. As the number of pixels of an image sensor increases, its pixel pitch narrows and sensitivity deteriorates. In view of this, image sensors generally include a driving mode or condition in which a signal output from each pixel of a subject image on the light receiving surface is added under a predetermined condition to double brightness and increase sensitivity.
This pixel adding mode is used in preview operation in which subject images are displayed on an LCD with a certain interval. It is suitable for the preview operation since the number of pixels used for display data is reduced from the total pixel number because of the pixel addition.
FIG. 21 shows a typical pixel array of an image sensor 10, that is, Bayer array. A signal read from each pixel of the image sensor is added vertically and horizontally, thereby reducing the number of signals used in the following processing. For example, to generate image data for the preview operation, the number of signals can be reduced by addition and thinning under a certain rule instead of processing every one of signals output from all the pixels. FIG. 17 shows an example of the signal read from the image sensor 10 in a driving mode in which two pixels are added in vertical and horizontal directions.
Such a pixel addition may derange the AF evaluation value depending on the type of a subject. This is because the original spatial frequency bandwidth of an image is reduced by the pixel addition.
This pixel addition affects the autofocus processing differently at shooting during daytime or at night. For example, at daytime shooting, the contrast of each subject is sharply captured in a light ambient condition. However, at night shooting, the whole subject is dark in a dark ambient condition. In capturing a subject including a building, for example, light such as illumination leaking from the windows of a room becomes a dominant subject in an image. Such illumination leaking from a building is seen as points from distance so that such a dominant point-like subject is referred to as point source subject.
The point source subject has almost no contrast. Therefore, the curve of the AF evaluation value of the point source subject does not show a peak as shown in FIG. 22, so that the maximal AF evaluation value cannot be determined. Further, the AF evaluation value becomes lowest at the lens position which would be an in-focus position at daytime shooting. This is because light appears to expand as the degree of out-of focus increases.
In view of this, Japanese Patent No. 4679179 discloses an imaging device which can accurately perform autofocus at low brightness by multiplying filters to output the AF evaluation value. In shooting a point source subject with this imaging device, the narrowed frequency bandwidth by the pixel addition and the multiplied filters make autofocus further difficult.
Further, Japanese Patent No. 4553570 discloses an imaging device which can improve autofocus accuracy by removing high brightness portions (point sources) from an image. However, at night shooting, the removal of point sources makes it difficult to detect a focal point since the brightness around the point sources is low.
Although the contrast of a subject including dominant or saturated point sources is low, it is possible to detect the peak of the AF evaluation value by reducing the number of horizontal pixel additions of the image sensor.
FIG. 23 shows changes in the AF evaluation value at horizontal one, two, three, and four pixel addition. It can be seen from the drawing that the curve at one pixel addition does not exhibit a peak but the peak of the AF evaluation value appears while reducing the number of horizontal pixel additions.
Thus, relative to subjects with small contrast such as a punctuate subject, the AF evaluation value with no peak is caused by the number of pixel additions rather than the point source. However, the sensitivity of the image sensor lowers by reducing the number of pixel additions or performing no pixel addition. Therefore, it is required to obtain the peak of the AF evaluation value of a point source subject without a decrease in the sensitivity.